package com.glorystone.ins.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;

public
@Data @NoArgsConstructor
@AllArgsConstructor
@Builder
class Product{
    //主键id
    private Long tid;

    //产品编号
    private String productId;

    //业务员
    private String userName;

    //业务员id
    private Long userId;

    private String name;

    //保险公司id
    private Long companyId;

    //保险公司
    private String company;

    //合同有效期
    @JsonSerialize(using = CustomLocalDateSerializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate contractTime;

    private String time;

    private String times;

    private Integer t;

    //意见
    private String opinion;

    //价税分离
    private Integer separateStatus;

    //补点开票形式
    private Integer modalityStatus;

    //审核节点
    private Integer checkNode;

    //审核状态
    private Integer checkStatus;

    //险种
    private Integer type;

    //定价状态
    private Integer priceStatus;

    //使用状态
    private Integer useStatus;

    //创建人
    private Long createBy;

    //创建时间
    private Date createDate;

    //修改人
    private Long updateBy;

    //修改时间
    private Date updateDate;

    //删除标识
    private Integer delFlag;

    private List<EaringPoint> earingPointList;

    public enum SeparateStatusEnum{
        SEPARATESTATUS_YES(1),
        SEPARATESTATUS_NO(2);
        private Integer value;

        public Integer getValue(){
            return this.value ;
        }
        private SeparateStatusEnum(Integer value) {
            this.value = value;
        }
    }

    public enum TypeStatusEnum{
        COMPULSORY_INSURANCE(0),
        BUSINESS_INSURANCE(1);
        private Integer value;

        public Integer getValue(){
            return this.value ;
        }
        private TypeStatusEnum(Integer value) {
            this.value = value;
        }
    }


    public enum  CheckEnum{
        //待设置税点
        CHECK_POINT(0),
        //待设置自留点位
        CHECK_EARING_POINT(1),
        //待审核
        CHECK_SUCCESS(2),
        //初审
        CHECK_FIRST(3),
        //复审
        CHECK_AGAIN(4),
        //驳回
        CHECK_REJECT(5);
        private Integer value;

        public Integer getValue(){
            return this.value ;
        }
        private CheckEnum(Integer value) {
            this.value = value;
        }
    }

    public enum CheckStatusEnum{
        //设置定价中
        CHECK_STATUS_READ(0),
        //审核中
        CHECK_STATUS_MIDDEL(1),
        //审核驳回
        CHECK_STATUS_REJECT(2),
        //过期
        CHECK_STATUS_OVERTIME(3);
        private Integer value;

        public Integer getValue(){
            return this.value ;
        }
        private CheckStatusEnum(Integer value) {
            this.value = value;
        }
    }

    public enum PriceEnum{
        //待定价
        PRICE_STATUS_NO(0),
        //已定价
        PRICE_STATUS_YES(1),
        //历史
        PRICE_STATUS_HISTORY(2);
        private Integer value;

        public Integer getValue(){
            return this.value ;
        }
        private PriceEnum(Integer value) {
            this.value = value;
        }
    }
    public enum DelEnum{
        DEL_FLAG_NO(0),DEL_FLAG_YES(1);
        private Integer value;

        public Integer getValue(){
            return this.value ;
        }
        private DelEnum(Integer value) {
            this.value = value;
        }
    }
    public enum UseEnum{
        USE_STATUS_YES(0),
        USE_STATUS_NO(1),
        USE_STATUS_OLD(2),
        USE_STATUS_OVERTIME(3);
        private Integer value;

        public Integer getValue(){
            return this.value ;
        }
        private UseEnum(Integer value) {
            this.value = value;
        }
    }
}